//
//  MainSectionCell.m
//  CBT
//
//  Created by 四点钟 on 2018/11/16.
//  Copyright © 2018 Mr.Zhang. All rights reserved.
//

#import "MainSectionCell.h"
#import <Masonry.h>

@interface MainSectionCell()

@property (nonatomic, strong) UIImageView *iconImageView;

@end

@implementation MainSectionCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle  = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];
        [self initSubViews];
    }
    return self;
}


- (void)initSubViews
{
    _iconImageView = [[UIImageView alloc]init];
    _iconImageView.image = [UIImage imageNamed:@"shouye_shangjiabizhong"];
    [self.contentView addSubview:_iconImageView];

    _title = [[UILabel alloc]init];
    _title.textColor = DefaultPurpleColor;
    _title.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_title];
    
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    [_iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(17);
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(9);
    }];
    
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.iconImageView.mas_right).offset(8);
        make.top.mas_equalTo(8);
        make.height.mas_equalTo(20);
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
